/*
 ============================================================================
 Name		: LemonAssistantAppView.cpp
 Author	  : 
 Copyright   : Your copyright notice
 Description : Application view implementation
 ============================================================================
 */

// INCLUDE FILES
#include <aknviewappui.h>

#include "LemonAssistantAppView.h"

#include <LemonAssistant.rsg>
#include "LemonAssistant.hrh"

// ============================ MEMBER FUNCTIONS ===============================
CLemonAssistantAppView::CLemonAssistantAppView()
	{
	// No implementation required
	iContainer = NULL;
	}

CLemonAssistantAppView::~CLemonAssistantAppView()
	{
	DoDeactivate();
	}

CLemonAssistantAppView* CLemonAssistantAppView::NewLC()
	{
	CLemonAssistantAppView* self = new (ELeave) CLemonAssistantAppView();
	CleanupStack::PushL(self);
	self->ConstructL();
	return self;
	}

CLemonAssistantAppView* CLemonAssistantAppView::NewL()
	{
	CLemonAssistantAppView* self = CLemonAssistantAppView::NewLC();
	CleanupStack::Pop(); // self;
	return self;
	}

void CLemonAssistantAppView::ConstructL()
	{
	//BaseConstructL(R_VIEW_APP);
	BaseConstructL();

	//add your code here...

	}
/**
 * 
 * */
TUid CLemonAssistantAppView::Id() const
	{
	return TUid::Uid(ELemonAssistantAppViewId);
	}
void CLemonAssistantAppView::HandleCommandL(TInt aCommand)
	{
	switch (aCommand)
		{
		default:
			AppUi()->HandleCommandL(aCommand);
		}
	}
void CLemonAssistantAppView::HandleStatusPaneSizeChange()
	{
	if (iContainer != NULL)
		iContainer->SetRect(ClientRect());
	}

/**
 * 
 * */
void CLemonAssistantAppView::DoActivateL(const TVwsViewId& aPrevViewId,
		TUid aCustomMessageId, const TDesC8& aCustomMessage)
	{
	if (iContainer == NULL)
		{
		iContainer = CLemonAssistantAppContainer::NewL(ClientRect());
		iContainer->SetMopParent(this);
		AppUi()->AddToStackL(*this, iContainer);

		//add your init code ...

		}
	}
void CLemonAssistantAppView::DoDeactivate()
	{
	if (iContainer != NULL)
		{
		AppUi()->RemoveFromViewStack(*this, iContainer);
		delete iContainer;
		iContainer = NULL;
		}
	}
// End of File
